package elevatronic.view.left;

import java.util.ArrayList;
import java.util.List;

import elevatronic.models.Button;
import elevatronic.view.ImageView;

/**
 * 
 * @author Benjamin CORNEC * 
 * button view of button model
 *
 */
public class ButtonView {
	//button model
	private Button button;
	public Button getButton() {
		return button;
	}
	public void setButton(Button button) {
		this.button = button;
	}
	
	
	//image of the button
	private ImageView imageButton;
	public ImageView getImageButton() {
		return imageButton;
	}
	public void setImageButton(ImageView imageButton) {
		this.imageButton = imageButton;
	}
	
	//List of images
	public List<ImageView> getImages() {
		List<ImageView> retour= new ArrayList<ImageView>();
		retour.add(getImageButton());
		return retour;
	}
	
	
	
	//constructor
	public ButtonView(Button button, String imgUrl, int posX, int posY, int wdth, int hght){
	    ImageView image=new ImageView(imgUrl,posX,posY,wdth,hght);
	    image.setPosX(posX);
	    image.setPosY(posY);
	    image.setVisible(false);
	    setImageButton(image);
		setButton(button);
	}
	
	//iteration of the button
	public void update(int step){
		getImageButton().setVisible(getButton().isPushed());
	}
}
